package com.tl.ip_location_relation_v4.entity;

import java.io.Serializable;

public class Ip implements Comparable<Ip>,Serializable{
	private long startIp;
	private long endIp;
	private String area;
	
	public Ip(long startIp, long endIp, String area) {
		this.startIp = startIp;
		this.endIp = endIp;
		this.area = area;
	}
	
	public long getStartIp() {
		return startIp;
	}
	public void setStartIp(long startIp) {
		this.startIp = startIp;
	}
	public long getEndIp() {
		return endIp;
	}
	public void setEndIp(long endIp) {
		this.endIp = endIp;
	}
	public String getArea() {
		return area;
	}
	public void setArea(String area) {
		this.area = area;
	}

	@Override
	public int compareTo(Ip o) {
		long result = this.startIp-o.startIp;
		return result>0?1:(result<0?-1:0);
	}
}
